<?php
namespace App\Http\Controllers\ApiApp;

use App\DBs\VideoDB;
use Illuminate\Http\Request;

class SysController extends BaseController
{
    /**
     * 系统参数
     */

    protected $db;

    public function __construct()
    {
        parent::__construct();
        $this->db = new VideoDB();
    }

    public function getIndex(Request $request)
    {
        $access = $this->db->getAccess();
        if (!$access) {
            return $this->toAppJson(-2);
        }
        $dataArr = array(
            'day' => date('Ymd',time()),
            'domain' => env('NEXTDOMAIN'),
            'appAccess' => $access,
        );
        return $this->toAppJson(0,$dataArr);
    }
}
